﻿@model  IEnumerable<MusicOnLine.Models.Artist>

@{
    ViewBag.Title = "艺术家列表";
    var oldStr = "";
}
<style type="text/css">
    #divArtContent
    {
        float:left;       
        margin-left:10px; 
        width:900px; 
        overflow-x:hidden;   margin-bottom:10px;      
    }
</style>
 
@foreach (var item in Model)
{
    if (oldStr != item.StartWith)
    {    
        <div class="divArtist" style="height:5px; display:none;"></div>  
        <div id="div@(item.StartWith)" class="divArtist" style=" font-style:italic; clear:both; margin-top:20px;  font-weight:900; display:none;">@item.StartWith</div>
      
        <div class="divStart aStartWith" style=" font-style:italic; color:#669900; font-weight:900; display:none; cursor:pointer;">@item.StartWith</div>
       
    oldStr = item.StartWith;
    }    
    <div class="divArtist" style=" float:left; margin-right:10px;display:none;">@Html.ActionLink(item.ArtistName, "SingerAlbums", "AACInfo", new { ID = item.ID }, null)</div>
}
<div>    
    <div id="divArtContent">
        <div id="divArtists"></div>
    </div>
    <div  style="float:left; width:10px; margin-left:1000px; position:fixed; margin-top:50px;">
        <div id="divStartWith"></div>
    </div>
</div>
<div style="clear:both;"></div>
<script type="text/javascript">
    $(document).ready(function () {
        $(".divMenu").removeClass("currentMenu");
        $("#divHomeSingerList").addClass("currentMenu");
        $(".divStart").insertAfter($("#divStartWith"));
        $(".divStart").show();
        $(".divArtist").insertAfter($("#divArtists"));
        $(".divArtist").show();
        $(".aStartWith").click(function () {
            var sw = $(this).text();
            var pTop = $("#div" + sw).position().top;          
            if (pTop != 0) {
                var scrollTop = $("#divArtContent").scrollTop();               
                window.scroll(0, pTop-110);
            }
        });
        $("#btnSearch").click(function () {
            var s = $("#txtQText").val();
            window.location = "/Home/SearchResult/?s=" + s;
        });
    })
</script>
